//
//  LLChannelShowCell.m
//  LoveLove
//
//  Created by 肖兰月 on 2019/4/2.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "LLChannelShowCell.h"
#import "LLChannelModel.h"

@interface LLChannelShowCell ()
@property (strong, nonatomic) LLButton *button;
@end

@implementation LLChannelShowCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubView];
    }
    return self;
}

- (void)initSubView {
    _button = [LLInitBaseViewTool buttonWithTitle:nil image:nil titleColor:nil font:15];
    _button.frame = self.bounds;
    _button.layer.borderColor = LLColor(225, 0, 0).CGColor;
    _button.layer.cornerRadius = self.bounds.size.height/2.0;
    [self.contentView addSubview:_button];
    _button.userInteractionEnabled = NO;
}

- (void)setModel:(LLChannelModel *)model {
    _model = model;
    if (model.isSelected.integerValue) {
        [_button setTitleColor:LLColor(225, 0, 0) forState:0];
        _button.layer.borderWidth = 1;
        _button.backgroundColor = UIColor.whiteColor;
    } else {
        [_button setTitleColor:LLColorRGB(0) forState:0];
        _button.layer.borderWidth = 0;
        _button.backgroundColor = LLColorRGB(238);
    }
    [_button setTitle:model.interest_name forState:0];
}

- (void)setLaunchChannelModel:(LLChannelModel *)launchChannelModel {
    _launchChannelModel = launchChannelModel;
    if (launchChannelModel.isSelected.integerValue) {
        [_button setTitleColor:UIColor.whiteColor forState:0];
        _button.layer.borderWidth = 0;
        _button.backgroundColor = LLColor(225, 0, 0);
    } else {
        [_button setTitleColor:LLColor(225, 0, 0) forState:0];
        _button.layer.borderWidth = 1;
        _button.backgroundColor = LLColorRGB(255);
    }
    [_button setTitle:launchChannelModel.interest_name forState:0];
}


@end
